import {customeStruct} from '../utils';
const itf = customeStruct.interface;

const defaultProps = {
    id: 'string',
    partWarrantyPolicyId: 'string',
    options: [
        'string'
    ]
};
export const List = itf({
    payload: itf({
        content: [itf(defaultProps)],
        totalElements: 'number'
    })
});

export const Detail = itf({
    payload: itf({
        id: 'string',
        type: 'number',
        warrantyDuration: 'number',
        warrantyMileage: 'number',
        remark: 'string? | null',
        vehicleCategoryItems: [itf(
            {
                id: 'string',
                productCategoryId: 'string',
                productCategoryCode: 'string',
                productCategoryName: 'string',
                remark: 'string? | null',
                partWarrantyCategories: [itf(
                    {
                        id: 'string',
                        code: 'string',
                        name: 'string',
                    }
                )]
            }
        )],
        vehicleItems: [itf(
            {
                vehicleId: 'string',
                vin: 'string',
                remark: 'string? | null',
                parts: [itf(
                    {
                        id: 'string',
                        code: 'string',
                        name: 'string',
                    }
                )]
            }
        )]
    })
});

export const Order = itf({
    payload: itf({
        content: [itf({
            id: 'string',
            code: 'string',
            name: 'string',
            startDate: 'datetime',
            remark: 'string? | null',
            rowVersion: 'string? | null',
            options: [
                'string'
            ]
        })],
    })
});

export const OrderDetail = itf({
    payload: itf({
        id: 'string',
        code: 'string',
        name: 'string',
        startDate: 'datetime',
        remark: 'string? | null',
        rowVersion: 'string',
        creatorName: 'string? | null',
        createTime: 'datetime? | null',
        modifierName: 'string? | null',
        modifyTime: 'datetime? | null',
        abandonerName: 'string? | null',
        abandonTime: 'datetime? | null',
        options: [
            'string'
        ],
        items: [itf(
            {
                id: 'string',
                type: 'number',
                warrantyDuration: 'number',
                warrantyMileage: 'number',
                remark: 'string? | null',
                vehicleCategoryItems: [itf(
                    {
                        id: 'string',
                        productCategoryId: 'string',
                        productCategoryCode: 'string',
                        productCategoryName: 'string',
                        partWarrantyCategories: [itf(
                            {
                                id: 'string',
                                code: 'string',
                                name: 'string',
                                remark: 'string? | null',
                            }
                        )]
                    }
                )],
                vehicleItems: [itf(
                    {
                        vehicleId: 'string',
                        vin: 'string',
                        parts: [itf(
                            {
                                id: 'string',
                                code: 'string',
                                name: 'string',
                                remark: 'string? | null',
                            }
                        )]
                    }
                )]
            }
        )]
    })
});

export const Part = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string',
            })
        ],
        totalElements: 'number'
    })
});


export const PartWarrantyCategory = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string',
            })
        ],
        totalElements: 'number'
    })
});
export const ProductCategory = itf({
    payload: itf({
        content: [itf({
            id: 'string',
            name: 'string',
            code: 'string',
            remark: 'string? | null'
        })]
    })
});

export const VehicleInfo = itf({
    payload: itf({
        content: [itf({
            id: 'string',
            vin: 'string'
        })],
        totalElements: 'number'
    })
});

export const Brand = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string',
            })
        ],
    })
});
